#ifndef __59WORKERMI_H__
#define __59WORKERMI_H__

#include <string>
#include <iostream>

class Worker
{
private:
    std::string fullname;
    long id;

protected:
    virtual void Data() const;
    virtual void Get();

public:
    Worker() : fullname("no one"), id(0L) {}
    Worker(const std::string fullname, long id) : fullname(fullname), id(id) {}

    virtual void Set() = 0;        // pure virtual method
    virtual void Show() const = 0; // pure virtual method

    virtual ~Worker() = 0;
};

class Waiter : virtual public Worker
{
private:
    int panache;

protected:
    void Data() const;
    void Get();

public:
    Waiter() : Worker(), panache(0) {}
    Waiter(const std::string fullname, long n, int p = 0) : Worker(fullname, n), panache(p) {}
    Waiter(const Worker &wk, int p = 0) : Worker(wk), panache(p) {}

    void Set();
    void Show() const;
};

class Singer : virtual public Worker
{
protected:
    enum
    {
        other,
        alto,
        contraltos,
        soprano,
        bass,
        baritone,
        tenor
    };

    enum
    {
        Vtypes = 7
    }; // 定义了一个数字名称

    void Data() const;
    void Get();

private:
    static char *pv[Vtypes];
    int voice;

public:
    Singer() : Worker(), voice(other) {}
    Singer(const std::string fullname, long n, int v = other) : Worker(fullname, n), voice(v) {}
    Singer(const Worker &wk, int v = other) : Worker(wk), voice(v) {}

    void Set();
    void Show() const;
};

class SingerWaiter : public Singer, public Waiter
{
protected:
    void Data() const;
    void Get();

public:
    SingerWaiter() {}
    SingerWaiter(const std::string &s, long n, int p = 0,
                 int v = other)
        : Worker(s, n), Waiter(s, n, p), Singer(s, n, v) {}
    SingerWaiter(const Worker &wk, int p = 0, int v = other)
        : Worker(wk), Waiter(wk, p), Singer(wk, v) {}
    SingerWaiter(const Waiter &wt, int v = other)
        : Worker(wt), Waiter(wt), Singer(wt, v) {}
    SingerWaiter(const Singer &wt, int p = 0)
        : Worker(wt), Waiter(wt, p), Singer(wt) {}

    void Set();
    void Show() const;
};

#endif